<template>
	<view class="paper-item"  hover-class="hoverBg" @click="!item.score && item.status?startClick(item):clickItem">
		<view class="name">
			<view v-if="item.isreexam" class="badge badge--yellow"><text>重</text></view>
			<view v-if="item.status === 1" class="badge badge--green"><text>续</text></view>
			<text class="content">{{ item.examname }}</text>
			<view v-if="!item.score && item.status" >
				<my-icon name="dati" :style="{color:iconColor?'#3E7DF1':'#A6A6A6'}" style="font-size: 36upx;"></my-icon>
			</view>
			<!-- <image @click.stop="$emit('start-exam', item)" v-if="!item.score && item.status" style="width: 34upx;height: 38upx;" :src="require('../static/icon/exam.png')"></image> -->
			<text v-else :class="['score', item.score >= 60 && 'pass']">{{ item.score || 0 }}分</text>
		</view>
		<view class="info" v-if="!$scopedSlots.info">
			<template v-if="item.carrypapertime">
				<image :src="require('../static/icon/clock.png')"></image>
				<text>{{ item.carrypapertime }}</text>
			</template>
			<template v-else-if="item.state !== 1">
				<image :src="require('../static/icon/time.png')"></image>
				<text>{{ item.starttime }}~{{ item.endtime }}</text>
			</template>
		</view>
		<!-- 自定义底部信息 -->
		<view class="info"><slot name="info" v-bind="item"></slot></view>
	</view>
</template>

<script>
export default {
	props: {
		item: {
			type: Object,
			required: true
		},
		iconColor:{
			type: Boolean,
			default: true
		}
	},
	methods:{
		clickItem(){
			this.$emit('click-item');
		},
		startClick(data){
			this.$emit('start-exam',data);
		}
	}
};
</script>
<style scoped lang="scss">
	.paper-item {
		.name{
			margin-bottom:15upx!important;
		}
	}
	.hoverBg{
		background: #ebebeb;
	}
</style>